﻿<cfscript>
/** 
* Senate Frameworks taskClassFactory
* 
* @hint "The Task Loader." 
*/ 

component 
	displayname="public.service.handler.taskClassFactory" 
	output=false 
	{

	/* PROPERTIES */
	
	/**
	* @hint "初始化对象"
	*/
	public public.service.handler.taskClassFactory function init() output=false {
		return this;
	}
	
	/**
	* @hint "加载教学任务"
	* 
	* @taskType "任务类别"
	* @taskId "教学任务号"
	*/
	public function loadTaskClass(required string taskType, required string taskId) output=false {
		
		switch (arguments.taskType) {
				
			case "C":
				return EntityLoad("CommonTask", arguments.taskId, true);
				break;

			case "P":
				return EntityLoad("ProgramTask", arguments.taskId, true);
				break;
			
			case "R":
				return EntityLoad("OpenTask", arguments.taskId, true);
				break;
			
			case "T":
				return EntityLoad("SportTask", arguments.taskId, true);
				break;

		}
		
	}
	

}

</cfscript>